{template 'header'}
<link href="{MODULE_URL}template/css/css.css" rel="stylesheet" />
<link href="{MODULE_URL}template/css/stylesheet.css" rel="stylesheet" />

<a href="{php echo $this->createMobileUrl('fled',array('op'=>'post'))}" class="top_menu">
    <img src="{MODULE_URL}template/image/fb.png" />发布+
</a>

<div class="top_menu_shadow"></div>
<form action="" method="post">
<div class="row" style="width:90%;margin:0 auto">
  <div class="col-lg-6">
    <div class="input-group">
      <input type="text" class="form-control" name="keyword" placeHolder="请输入二手商品名称">
      <span class="input-group-btn">
        <button class="btn btn-default" type="submit"> <i class="glyphicon glyphicon-search"></i></button>
     <!--    <input type="hidden" name="token" value="{$_W['token']}" /> -->
      </span>
    </div><!-- /input-group -->
  </div>
</div>
</form>
<div id='list'  style='margin-bottom:50px;'>
{loop $list $item}
<div class="fy">
    <a href="{php echo $this->createMobileUrl('fled',array('op'=> 'detail','id'=> $item['id']))}" class="sq_box commodity">
        <div class="commodity_img">
            <img src="{if $item['img']}{$item['img'][0]['src']}{else}{MODULE_URL}template/image/Nopictures.jpg{/if}" />

        </div>
        <div class="commodity_content">
            <div class="commodity_content_info">
                <div class="content_info_l">
                    <div class="info_l_x"></div>
                    <div class="info_l_s"><span>{$item['title']}</span>
                    </div>
                    <div class="info_l_x">
                        <input type="hidden" class="recordId" value="378" />
                        <span class="unread">
                            {$item['rolex']}
                        </span>
                    </div>
                </div>
                <div class="content_info_r">
                    <span class="price">￥</span><span class="price_num">{$item['zprice']}</span>
                </div>
            </div>
            <div class="commodity_address">
                <span class="comm_add">社区：{$item['regionname']}</span>
            </div>
        </div>
    </a>
    <div class="commodity_fbxx">

    {if $op=='my'}
        <div class="commodity_name">
            <div class="edit_del_btn" onclick="window.location.href='{php echo $this->createMobileUrl(fled,array('op' => 'post','id'=> $item['id']))}'">编辑</div>
            <div class="edit_del_btn" onclick="delsell({$item['id']})">删除</div>
        </div>
    {/if}

        <div class="commodity_time">


            <font color="blue"></font>{php echo date('Y-m-d H:i:s', $item['createtime'])}


        </div>
    </div>

</div>
{/loop}
</div>
<div style="display:none;left: 0px;top: 0px;width: 100%;height: 100%;overflow: hidden;position: fixed;background: rgba(0, 0, 0, 0.5);" id="layer">

</div>
{if count($list)>9}
<div style="margin-top:20px;margin-bottom:70px;text-align:center;font-size:16px;" id='view' >查看更多</div>
{/if}
<script>
var page = 2;
$(function() {
    $("#view").click(function() {
        $('#layer').show();
        obj=$(this);
        $(this).html('正在加载中...')
        $.get("{php echo $this->createMobileUrl('fled',array('op'=>'more'))}&page="+page, function(result){
                    if(result!=''){
                        $('#list').append(result);
                        page++;    
                        obj.html('查看更多');
                    }else{
                        obj.hide();
                    }
                    $('#layer').hide();
            });
        });
});
</script>
<script type="text/javascript">
    function delsell(id){
      
            $.getJSON("{php echo $this->createMobileUrl('fled',array('op'=> 'delete'))}", {'id':id}, function(json){
                if(json.message.state==0){
                    location.reload();
                }
            });
    }
</script>
{template 'footer'}
